# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Thayer Williams <jason@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=bbpager
pkgver=0.4.7
pkgrel=9
pkgdesc="A dockable pager for Blackbox and other window managers"
arch=('loong64' 'x86_64')
url="http://bbtools.sourceforge.net/download.php?file=6"
license=('GPL')
depends=('gcc-libs' 'libxft' 'libxext' 'blackbox')
makedepends=('patch')
source=(https://downloads.sourceforge.net/bbtools/$pkgname-$pkgver.tar.gz
        02_gcc43.dpatch
        fix-linking-ugly.diff
        autotools.patch)
sha256sums=('e7063a8d65c25663f44e2769132053bd3f1b90f0d4b19a8d8aa2e5f028f0679d'
            '52502c91715e1ffa3b2be758ad80fecfbc44bc1a41f3c96d6de08d23196e418e'
            '7ec451d6cc390f65bcf6c85f4d16662b900896d6b3349ff0566409b4335b765c'
            'd7da4d58db949389e8a890aac5a17fae7eb7887ef03c9d97c94e50cfe2574aef')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver

  patch -Np1 -i ../02_gcc43.dpatch
  patch -Np1 -i ../fix-linking-ugly.diff
  patch -Np1 -i ../autotools.patch

  aclocal
  automake --add-missing
  autoreconf
}

build() {
  cd "${srcdir}"/$pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  make prefix="${pkgdir}"/usr install
}
